/*
 * @Author: lz08 liuzheng@ceepower.com
 * @Date: 2022-11-30 14:19:50
 * @LastEditors: lz08 liuzheng@ceepower.com
 * @LastEditTime: 2022-12-03 17:10:25
 * @FilePath: \vue3-ts-cms\src\router\index.ts
 * @Description: 这是默认设置,请设置`customMade`, 打开koroFileHeader查看配置 进行设置: https://github.com/OBKoro1/koro1FileHeader/wiki/%E9%85%8D%E7%BD%AE
 */
import { createRouter, createWebHistory, RouteRecordRaw } from 'vue-router'

const routes: Array<RouteRecordRaw> = [
  {
    path: '/login',
    name: 'login',
    component: () => import('../views/login/index.vue')
  },
  {
    path: '/index',
    component: () => import('../views/index/index.vue')
  },
  {
    path: '/',
    component: () => import('@/layout/index.vue'),
    redirect: 'dashboard',
    children: [
      {
        path: 'dashboard',
        name: 'Dashboard',
        component: () => import('@/views/dashboard/index.vue'),
        meta: {
          title: '首页',
          icon: 'dashboard'
        }
      }
    ]
  },
  {
    path: '/404',
    name: 'PageNotExist',
    component: () => import('../views/404.vue'),
  },
  {
    path: "/:catchAll(.*)",
    redirect: '/404'
  },
]

const router = createRouter({
  history: createWebHistory(process.env.BASE_URL),
  routes
})

export default router
